<?php
// +----------------------------------------------------------------------
// | Description: 系统配置
// +----------------------------------------------------------------------
// | Author: orchief
// +----------------------------------------------------------------------

namespace app\admin\controller;

use app\common\controller\ApiCommon;

class SystemConfigs extends ApiCommon
{
    public $modelName = 'SystemConfig';
    public static $model;
    public function _initialize()
    {
        parent::_initialize();
        $this -> abort(!$this -> isClient, 'Permission denied', 403);
        self::$model = model($this -> modelName);
    }

    public function index()
    {
        $data = self::$model->getDataList();
        $this->jsonData($data);
    }

    public function save()
    {
        
        $res = self::$model->createData($this->param);
        $this->checkRes($res, '添加成功', self::$model->getError());
    }
}
